﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdAveMapping : IDisposable
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdAveMapping(IntPtr cPtr, bool cMemoryOwn)
		{
			this.swigCMemOwn = cMemoryOwn;
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdAveMapping obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdAveMapping()
		{
			this.Dispose();
		}

		public virtual void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdAveMapping(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
		}

		public OdAveMapping() : this(TD_DbPINVOKE.new_OdAveMapping(), true)
		{
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool getMapping(OdDbObjectId objectId)
		{
			bool result = TD_DbPINVOKE.OdAveMapping_getMapping(this.swigCPtr, OdDbObjectId.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setMapping(OdDbObjectId objectId)
		{
			TD_DbPINVOKE.OdAveMapping_setMapping(this.swigCPtr, OdDbObjectId.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public static void clearMapping(OdDbObjectId objectId)
		{
			TD_DbPINVOKE.OdAveMapping_clearMapping(OdDbObjectId.getCPtr(objectId));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public SetuvType m_MappingType
		{
			get
			{
				SetuvType result = (SetuvType)TD_DbPINVOKE.OdAveMapping_m_MappingType_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_MappingType_set(this.swigCPtr, (int)value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Pt1
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Pt1_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Pt1_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Pt2
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Pt2_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Pt2_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Pt3
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Pt3_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Pt3_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Pt4
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Pt4_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Pt4_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public TileMethod m_Tile
		{
			get
			{
				TileMethod result = (TileMethod)TD_DbPINVOKE.OdAveMapping_m_Tile_get(this.swigCPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Tile_set(this.swigCPtr, (int)value);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Scale
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Scale_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Scale_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGePoint3d m_Offset
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Offset_get(this.swigCPtr);
				OdGePoint3d result = (intPtr == IntPtr.Zero) ? null : new OdGePoint3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Offset_set(this.swigCPtr, OdGePoint3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		public OdGeMatrix3d m_Transform
		{
			get
			{
				IntPtr intPtr = TD_DbPINVOKE.OdAveMapping_m_Transform_get(this.swigCPtr);
				OdGeMatrix3d result = (intPtr == IntPtr.Zero) ? null : new OdGeMatrix3d(intPtr, false);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
				return result;
			}
			set
			{
				TD_DbPINVOKE.OdAveMapping_m_Transform_set(this.swigCPtr, OdGeMatrix3d.getCPtr(value));
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;

		protected bool swigCMemOwn;
	}
}
